# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=gojq
pkgver=0.12.14
pkgrel=0
pkgdesc="Pure Go implementation of jq"
url="https://github.com/itchyny/gojq"
license="MIT"
arch="all"
makedepends="go"
subpackages="$pkgname-zsh-completion"
source="https://github.com/itchyny/gojq/archive/v$pkgver/gojq-$pkgver.tar.gz"

export CGO_ENABLED=0
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build ./cmd/gojq
}

check() {
	go test ./...
}

package() {
	install -Dm755 gojq -t "$pkgdir"/usr/bin/

	install -Dm644 _gojq -t "$pkgdir"/usr/share/zsh/site-functions/
}

sha512sums="
45641d0cc3fd4041fe68a17b1e45ad85e334fb6996509033ea36257ea74711c9542aedd237cfd8054fe7f974d53970de9a18c3958f4a72303739da2a69c997da  gojq-0.12.14.tar.gz
"
